package com.cafuc.javaEE.util;



import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.Properties;

@Component
public class ConfigUtil2 {
    @Value("classpath:/jdbc.properties")
    private Resource resource;

    public Properties getProperties(){
        Properties properties = new Properties();
        try {
            properties.load(resource.getInputStream());
        } catch (IOException e) {
            e.printStackTrace();
        }
        return properties;
    }

}
